#!/bin/bash

#echo  'KERNEL=="ttyACM*", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE:="0777", GROUP:="dialout",  SYMLINK+="sensor_imu"' >/etc/udev/rules.d/myusb.rules
echo  'KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE:="0777", SYMLINK+="sonar_hw"' >/etc/udev/rules.d/myusb.rules

#KERNEL=="ttyS6", MODE:="0777", SYMLINK+="RTK"
#KERNEL=="ttyUSB*", ATTRS{bInterfaceNumber}=="03", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="15c3", MODE:="0777", SYMLINK+="HW_5G"
#ACTION=="add", KERNELS=="2-2:2.3", SUBSYSTEMS=="usb", MODE:="0777", SYMLINK+="HW_5G"
#KERNEL=="ttyUSB*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", MODE:="0777", SYMLINK+="ROCR6"
#KERNEL=="ttyUSB*", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE:="0777", SYMLINK+="RS232"
#KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE:="0777", SYMLINK+="rplidar"
#KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE:="0777", SYMLINK+="sonar_hw"
#ACTION=="add",SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="0053", GROUP="users", MODE="0777"

service udev reload
sleep 1
service udev restart
